
clear
use "proc_data\SCAD2021-01-07.dta"

rename *, lower

*g sdate = date(startdate, "DMY")
*format sdate %td

label variable ccode "Correlates of War numeric designation of the country"
label variable countryname "Country name : SCAD"

label variable duration "Duration of event (number of days) : SCAD"

label variable startdate "Start date of event"
label variable styr "Start year"
label variable stmo "Start month"
label variable stday "Start day"

label variable enddate "End date of event"
label variable eyr "End year"
label variable emo "End month"
label variable eday "End day"

label define etypelabel 1 "Organized Demonstration" 2 "Spontaneous Demonstration" 3 "Organized Violent Riot" 4 "Spontaneous Violent Riot" 5 "General Strike" 6 "Limited Strike"7 "Pro-Government Violence (Repression)" 8 "Anti-Government Violence" 9 "Extra-government Violence" 10 "Intra-government Violence"
label values etype etypelabel
label variable etype "Indicates the type of event : SCAD"

label define escalationlabel 0 "No Escalation" 1 "Organized Demonstration" 2 "Spontaneous Demonstration" 3 "Organized Violent Riot" 4 "Spontaneous Violent Riot" 5 "General Strike" 6 "Limited Strike" 7 "Pro-Government Violence (Repression)" 8 "Anti-Government Violence" 9 "Extra-government Violence" 10 "Intra-government Violence"
label values escalation escalationlabel
label variable escalation "Did the nature of the event change during its duration? : SCAD"

label variable actor1 "Records the social, political, or identity group (i.e. actor) directly involved in the event"
label variable actor2 "Records the social, political, or identity group (i.e. actor) directly involved in the event"
label variable actor3 "Records the social, political, or identity group (i.e. actor) directly involved in the event"

label variable target1 "Records the social, political, or identity group directly targeted by the event"
label variable target2 "Records the social, political, or identity group directly targeted by the event"

label variable cgovtarget "Was the central government the target of the event? Yes = 1"
label variable rgovtarget "Was a regional, provincial or local government the target of the event? Yes = 1"

label define npartlabel 1 "less than 10" 2 "10 to 100" 3 "101 to 1,000" 4 "1,001 to 10,000" 5 "10,001 to 100,000" 6 "100,001 to 1,000,000" 7 "over 1,000,000" -99 "unknown"
label values npart npartlabel
label variable npart "Total number of participants in the event : SCAD"

g ndeathmiss = ndeath if ndeath < 0
label define ndeathlabel -99 "unknown" -88 "unknown but probably small (less than 10)" -77 "unknown but probably large (10 or more)"
label values ndeathmiss ndeathlabel
label variable ndeathmiss "SCAD categorical code for missing ndeath : SCAD"
replace ndeath =. if ndeath < 0

label variable ndeath "Persons killed. if mult, use mean or most recent. If not exact, use ndeathmiss : SCAD"

label variable repress "Did the government use repression or violence against participants in the event?"
label define represslabel 0 "no repression used" 1 "non-lethal repression used (e.g. tear gas, arrests, etc)" 2 "lethal repression used (there must be deaths reported)"
label values repress represslabel

label variable elocal "Identifies the name of the locality where the event occurred"
label variable ilocal "individual location"
label variable sublocal "numeric count of the individual locality"
label define locnumlabel 1 "Capital city" 2 "Other major urban area (population greater than 100,000)" 3 "Rural (including small towns, villages with population less than 100,000)" 4 "Multiple urban areas" 5 "Multiple rural areas" 6 "Province/region listed, exact location unknown" 7 "Nationwide. Effects several cities and rural areas" -99 "location unknown"
label values locnum locnumlabel
label variable locnum "Coding of the event locality"

label define issuelabel 1 "elections" 2 "economy, jobs" 3 "food, water, subsistence" 4 "environmental degradation" 5 "ethnic discrimination, ethnic issues" 6 "religious discrimination, religious issues" 7 "education" 8 "foreign affairs/relations" 9 "domestic war, violence, terrorism" 10 "human rights, democracy" 11 "pro-government" 12 "economic resources/assets" 13 "other" 14 "unknown, not-specified"

label values issue1 issuelabel
label values issue2 issuelabel
label values issue3 issuelabel

label variable issue1 "What was the 1st issue that was mentioned as the source of the tension/disorder?"
label variable issue2 "What was the 2nd issue that was mentioned as the source of the tension/disorder?"
label variable issue3 "What was the 3rd issue that was mentioned as the source of the tension/disorder?"

label variable issuenote "brief description of the event."
label variable nsource "Which news agency provided information on the event? AFP, AP, Both"
label variable notes "Additional info about the event. It lists any irregularities in the case, difficulties in coding, discrepancies between sources, etc"
label variable female_event "whether women and girls play a significant role in the event in question yes=1"
label variable lgtbq_issue "whether members of LGBTQ community play a significant role in the event yes=1"

label variable objectid "nearest unique grid cell id"
drop gid_0 

label variable acd_questionable "Events that may be related to armed conflicts as cataloged in Armed Conflict Database are marked =1"

label variable geo_comments "Additional notes on location and geocoding procedure : SCAD"

g bh = 1 if actor1=="Boko Haram" | actor1=="Suspected Boko Haram gunmen" | actor2=="Boko Haram" | actor3=="Boko Haram"
label variable bh "actor1 or 2 or 3 contains <Suspected> or <Boko Haram> : calc"

label variable location_precision "Flag for estimated point locations. Care when performing spatial analyses"


save "proc_data\SCAD_loc_level.dta", replace